﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartWMS.Common.NetWork
{
    public class ListHelper
    {
        /// <summary>
        /// list转字符串，并以separator拼接起来
        /// </summary>
        /// <param name="list">list集合</param>
        /// <param name="separator">拼接标识</param>
        /// <returns></returns>
        public static string ListToString(List<string> list, char separator)
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < list.Count; i++)
            {
                sb.Append(list[i]).Append(separator);
            }
            return sb.ToString().Substring(0, sb.ToString().Length - 1);
        }
    }
}
